package com.controller;

import com.service.MailServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MailController {

    @Autowired
    private MailServiceImpl mailService;


    /**
     * 发送邮件
     * @param mail 接收邮件地址
     * @return
     */
    @RequestMapping("/sendMail")
    public String sendMail(String mail){

        mailService.sendMail(mail);
        return "success";
    }

    @RequestMapping("/checkCode")
    public boolean checkCode(String mail,String code){
        return mailService.checkCode(mail,code);
    }

}
